﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinnerCMS.WebControls.BootStrap
{
    public class TextBox : System.Web.UI.WebControls.TextBox
    {
        /// <summary>
        /// 输入框水印
        /// </summary>
        [Browsable(true), Description("输入框水印"), Category("Html5")]
        public string Placeholder
        {
            get
            {
                object obj = ViewState["Placeholder"];
                return Convert.ToString(obj);
            }
            set { ViewState["Placeholder"] = value; }
        }

        protected override void OnPreRender(EventArgs e)
        {
            if (this.Placeholder.Length > 0)
                this.Attributes.Add("placeholder", this.Placeholder);

            base.OnPreRender(e);
        }
    }
}
